/*+**************************************************************************/
/***                                                                      ***/
/***   This file is distributed under a BSD license.                      ***/
/***   See LICENSE.txt for details.                                       ***/
/***                                                                      ***/
/**************************************************************************+*/

material TestShader
{
  vs asc vs_3_0
  {
    cbuffer TestMain : register(c0) : slot vs 0
    {
      row_major float4x4 ms_ss;
    };
    cbuffer TestTrans : register(c4) : slot vs 1
    {
      float4 mat[3];
    };

    use TestMain;
    use TestTrans;

    void main
    (
      in float3 ipos : POSITION,
      in float4 icol : COLOR0,
      in float2 iuv : TEXCOORD0,
      out float2 ouv : TEXCOORD0,
      out float4 opos : POSITION,
    )
    {
      ouv = iuv;
      float3 pos;
      pos.x = dot(mat[0],float4(ipos,1));
      pos.y = dot(mat[1],float4(ipos,1));
      pos.z = dot(mat[2],float4(ipos,1));
      opos = mul(float4(pos,1),ms_ss);
    }
  }

  ps asc ps_3_0
  {
    cbuffer TestPS1 : register(c0) : slot ps 0
    {
      float4 Mul;
    };
    cbuffer TestPS2 : register(c4) : slot ps 1
    {
      float4 Add;
    };

    use TestPS1;
    use TestPS2;
    sampler2D s0 : register(s0);

    void main
    (
      in float2 iuv : TEXCOORD0,
      out float4 ocol : COLOR0,
    )
    {
      ocol = tex2D(s0,iuv)*Mul+Add;
    }
  }
};

/**************************************************************************+*/
